<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Datasets</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
<link rel="start" href="index.html" title="GLib Reference Manual">
<link rel="up" href="glib-data-types.html" title="GLib Data Types">
<link rel="prev" href="glib-Keyed-Data-Lists.html" title="Keyed Data Lists">
<link rel="next" href="glib-Relations-and-Tuples.html" title="Relations and Tuples">
<meta name="generator" content="GTK-Doc V1.9 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="glib.html" title="GLib Overview">
<link rel="chapter" href="glib-fundamentals.html" title="GLib Fundamentals">
<link rel="chapter" href="glib-core.html" title="GLib Core Application Support">
<link rel="chapter" href="glib-utilities.html" title="GLib Utilities">
<link rel="chapter" href="glib-data-types.html" title="GLib Data Types">
<link rel="chapter" href="tools.html" title="GLib Tools">
<link rel="index" href="ix01.html" title="Index">
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
<link rel="index" href="ix03.html" title="Index of new symbols in 2.2">
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
<link rel="index" href="ix08.html" title="Index of new symbols in 2.12">
<link rel="index" href="ix09.html" title="Index of new symbols in 2.14">
<link rel="index" href="ix10.html" title="Index of new symbols in 2.16">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="glib-Keyed-Data-Lists.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="glib-data-types.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GLib Reference Manual</th>
<td><a accesskey="n" href="glib-Relations-and-Tuples.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id3414777" class="shortcut">Top</a>
                  &#160;|&#160;
                  <a href="#id3415088" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="glib-Datasets"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id3414777"></a><span class="refentrytitle">Datasets</span>
</h2>
<p>Datasets &#8212; associate groups of data elements with particular memory locations</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">

#include &lt;glib.h&gt;


#define             <a class="link" href="glib-Datasets.html#g-dataset-id-set-data">g_dataset_id_set_data</a>               (l, k, d)
void                <a class="link" href="glib-Datasets.html#g-dataset-id-set-data-full">g_dataset_id_set_data_full</a>          (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> dataset_location,
                                                         <a class="link" href="glib-Quarks.html#GQuark">GQuark</a> key_id,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data,
                                                         <a class="link" href="glib-Datasets.html#GDestroyNotify">GDestroyNotify</a> destroy_func);
void                (<a class="link" href="glib-Datasets.html#GDestroyNotify">*GDestroyNotify</a>)                   (<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>            <a class="link" href="glib-Datasets.html#g-dataset-id-get-data">g_dataset_id_get_data</a>               (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> dataset_location,
                                                         <a class="link" href="glib-Quarks.html#GQuark">GQuark</a> key_id);
#define             <a class="link" href="glib-Datasets.html#g-dataset-id-remove-data">g_dataset_id_remove_data</a>            (l, k)
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>            <a class="link" href="glib-Datasets.html#g-dataset-id-remove-no-notify">g_dataset_id_remove_no_notify</a>       (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> dataset_location,
                                                         <a class="link" href="glib-Quarks.html#GQuark">GQuark</a> key_id);

#define             <a class="link" href="glib-Datasets.html#g-dataset-set-data">g_dataset_set_data</a>                  (l, k, d)
#define             <a class="link" href="glib-Datasets.html#g-dataset-set-data-full">g_dataset_set_data_full</a>             (l, k, d, f)
#define             <a class="link" href="glib-Datasets.html#g-dataset-get-data">g_dataset_get_data</a>                  (l, k)
#define             <a class="link" href="glib-Datasets.html#g-dataset-remove-data">g_dataset_remove_data</a>               (l, k)
#define             <a class="link" href="glib-Datasets.html#g-dataset-remove-no-notify">g_dataset_remove_no_notify</a>          (l, k)

void                <a class="link" href="glib-Datasets.html#g-dataset-foreach">g_dataset_foreach</a>                   (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> dataset_location,
                                                         <a class="link" href="glib-Datasets.html#GDataForeachFunc">GDataForeachFunc</a> func,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);
void                (<a class="link" href="glib-Datasets.html#GDataForeachFunc">*GDataForeachFunc</a>)                 (<a class="link" href="glib-Quarks.html#GQuark">GQuark</a> key_id,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);
void                <a class="link" href="glib-Datasets.html#g-dataset-destroy">g_dataset_destroy</a>                   (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> dataset_location);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3415088"></a><h2>Description</h2>
<p>
Datasets associate groups of data elements with particular memory locations.
These are useful if you need to associate data with a structure returned
from an external library. Since you cannot modify the structure, you use
its location in memory as the key into a dataset, where you can associate
any number of data elements with it.
</p>
<p>
There are two forms of most of the dataset functions.
The first form uses strings to identify the data elements associated with
a location. The second form uses <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> identifiers, which are created
with a call to <a class="link" href="glib-Quarks.html#g-quark-from-string"><code class="function">g_quark_from_string()</code></a> or <a class="link" href="glib-Quarks.html#g-quark-from-static-string"><code class="function">g_quark_from_static_string()</code></a>.
The second form is quicker, since it does not require looking up the string
in the hash table of <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> identifiers.
</p>
<p>
There is no function to create a dataset. It is automatically created as
soon as you add elements to it.
</p>
<p>
To add data elements to a dataset use <a class="link" href="glib-Datasets.html#g-dataset-id-set-data"><code class="function">g_dataset_id_set_data()</code></a>,
<a class="link" href="glib-Datasets.html#g-dataset-id-set-data-full"><code class="function">g_dataset_id_set_data_full()</code></a>, <a class="link" href="glib-Datasets.html#g-dataset-set-data"><code class="function">g_dataset_set_data()</code></a>
and <a class="link" href="glib-Datasets.html#g-dataset-set-data-full"><code class="function">g_dataset_set_data_full()</code></a>.
</p>
<p>
To get data elements from a dataset use <a class="link" href="glib-Datasets.html#g-dataset-id-get-data"><code class="function">g_dataset_id_get_data()</code></a> and
<a class="link" href="glib-Datasets.html#g-dataset-get-data"><code class="function">g_dataset_get_data()</code></a>.
</p>
<p>
To iterate over all data elements in a dataset use <a class="link" href="glib-Datasets.html#g-dataset-foreach"><code class="function">g_dataset_foreach()</code></a> (not thread-safe).
</p>
<p>
To remove data elements from a dataset use <a class="link" href="glib-Datasets.html#g-dataset-id-remove-data"><code class="function">g_dataset_id_remove_data()</code></a> and
<a class="link" href="glib-Datasets.html#g-dataset-remove-data"><code class="function">g_dataset_remove_data()</code></a>.
</p>
<p>
To destroy a dataset, use <a class="link" href="glib-Datasets.html#g-dataset-destroy"><code class="function">g_dataset_destroy()</code></a>.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id3415293"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id3415303"></a><h3>
<a name="g-dataset-id-set-data"></a>g_dataset_id_set_data()</h3>
<a class="indexterm" name="id3415316"></a><pre class="programlisting">#define             g_dataset_id_set_data(l, k, d)</pre>
<p>
Sets the data element associated with the given <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> id.
Any previous data with the same key is removed, and its destroy function
is called.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>l</code></em>&#160;:</span></p></td>
<td>the location identifying the dataset.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>k</code></em>&#160;:</span></p></td>
<td>the <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> id to identify the data element.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>d</code></em>&#160;:</span></p></td>
<td>the data element.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3415396"></a><h3>
<a name="g-dataset-id-set-data-full"></a>g_dataset_id_set_data_full ()</h3>
<a class="indexterm" name="id3415410"></a><pre class="programlisting">void                g_dataset_id_set_data_full          (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> dataset_location,
                                                         <a class="link" href="glib-Quarks.html#GQuark">GQuark</a> key_id,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data,
                                                         <a class="link" href="glib-Datasets.html#GDestroyNotify">GDestroyNotify</a> destroy_func);</pre>
<p>
Sets the data element associated with the given <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> id, and also the
function to call when the data element is destroyed.
Any previous data with the same key is removed, and its
destroy function is called.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>dataset_location</code></em>&#160;:</span></p></td>
<td>the location identifying the dataset.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>key_id</code></em>&#160;:</span></p></td>
<td>the <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> id to identify the data element.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td>the data element.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>destroy_func</code></em>&#160;:</span></p></td>
<td>the function to call when the data element is removed. This
function will be called with the data element and can be used to free any
memory allocated for it.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3415545"></a><h3>
<a name="GDestroyNotify"></a>GDestroyNotify ()</h3>
<a class="indexterm" name="id3415558"></a><pre class="programlisting">void                (*GDestroyNotify)                   (<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);</pre>
<p>
Specifies the type of function which is called when a data element is
destroyed. It is passed the pointer to the data element and should free
any memory and resources allocated for it.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td>the data element.


</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3415608"></a><h3>
<a name="g-dataset-id-get-data"></a>g_dataset_id_get_data ()</h3>
<a class="indexterm" name="id3415621"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>            g_dataset_id_get_data               (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> dataset_location,
                                                         <a class="link" href="glib-Quarks.html#GQuark">GQuark</a> key_id);</pre>
<p>
Gets the data element corresponding to a <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>dataset_location</code></em>&#160;:</span></p></td>
<td>the location identifying the dataset.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>key_id</code></em>&#160;:</span></p></td>
<td>the <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> id to identify the data element.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td>the data element corresponding to the <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if it is
not found.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3415737"></a><h3>
<a name="g-dataset-id-remove-data"></a>g_dataset_id_remove_data()</h3>
<a class="indexterm" name="id3415750"></a><pre class="programlisting">#define             g_dataset_id_remove_data(l, k)</pre>
<p>
Removes a data element from a dataset.
The data element's destroy function is called if it has been set.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>l</code></em>&#160;:</span></p></td>
<td>the location identifying the dataset.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>k</code></em>&#160;:</span></p></td>
<td>the <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> id identifying the data element.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3415808"></a><h3>
<a name="g-dataset-id-remove-no-notify"></a>g_dataset_id_remove_no_notify ()</h3>
<a class="indexterm" name="id3415821"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>            g_dataset_id_remove_no_notify       (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> dataset_location,
                                                         <a class="link" href="glib-Quarks.html#GQuark">GQuark</a> key_id);</pre>
<p>
Removes an element, without calling its destroy notification function.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>dataset_location</code></em>&#160;:</span></p></td>
<td>the location identifying the dataset.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>key_id</code></em>&#160;:</span></p></td>
<td>the <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> ID identifying the data element.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td>the data previously stored at <em class="parameter"><code>key_id</code></em>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if none.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3415928"></a><h3>
<a name="g-dataset-set-data"></a>g_dataset_set_data()</h3>
<a class="indexterm" name="id3415941"></a><pre class="programlisting">#define             g_dataset_set_data(l, k, d)</pre>
<p>
Sets the data corresponding to the given string identifier.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>l</code></em>&#160;:</span></p></td>
<td>the location identifying the dataset.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>k</code></em>&#160;:</span></p></td>
<td>the string to identify the data element.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>d</code></em>&#160;:</span></p></td>
<td>the data element.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3416003"></a><h3>
<a name="g-dataset-set-data-full"></a>g_dataset_set_data_full()</h3>
<a class="indexterm" name="id3416016"></a><pre class="programlisting">#define             g_dataset_set_data_full(l, k, d, f)</pre>
<p>
Sets the data corresponding to the given string identifier, and the function
to call when the data element is destroyed.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>l</code></em>&#160;:</span></p></td>
<td>the location identifying the dataset.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>k</code></em>&#160;:</span></p></td>
<td>the string to identify the data element.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>d</code></em>&#160;:</span></p></td>
<td>the data element.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>f</code></em>&#160;:</span></p></td>
<td>the function to call when the data element is removed. This
function will be called with the data element and can be used to free any
memory allocated for it.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3416096"></a><h3>
<a name="g-dataset-get-data"></a>g_dataset_get_data()</h3>
<a class="indexterm" name="id3416109"></a><pre class="programlisting">#define             g_dataset_get_data(l, k)</pre>
<p>
Gets the data element corresponding to a string.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>l</code></em>&#160;:</span></p></td>
<td>the location identifying the dataset.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>k</code></em>&#160;:</span></p></td>
<td>the string identifying the data element.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td>the data element corresponding to the string, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if it is not
found.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3416180"></a><h3>
<a name="g-dataset-remove-data"></a>g_dataset_remove_data()</h3>
<a class="indexterm" name="id3416193"></a><pre class="programlisting">#define             g_dataset_remove_data(l, k)</pre>
<p>
Removes a data element corresponding to a string.
Its destroy function is called if it has been set.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>l</code></em>&#160;:</span></p></td>
<td>the location identifying the dataset.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>k</code></em>&#160;:</span></p></td>
<td>the string identifying the data element.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3416243"></a><h3>
<a name="g-dataset-remove-no-notify"></a>g_dataset_remove_no_notify()</h3>
<a class="indexterm" name="id3416257"></a><pre class="programlisting">#define             g_dataset_remove_no_notify(l, k)</pre>
<p>
Removes an element, without calling its destroy notifier.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>l</code></em>&#160;:</span></p></td>
<td>the location identifying the dataset.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>k</code></em>&#160;:</span></p></td>
<td>the string identifying the data element.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3416306"></a><h3>
<a name="g-dataset-foreach"></a>g_dataset_foreach ()</h3>
<a class="indexterm" name="id3416319"></a><pre class="programlisting">void                g_dataset_foreach                   (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> dataset_location,
                                                         <a class="link" href="glib-Datasets.html#GDataForeachFunc">GDataForeachFunc</a> func,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);</pre>
<p>
Calls the given function for each data element which is associated with the
given location.
Note that this function is NOT thread-safe. So unless <em class="parameter"><code>datalist</code></em>
can be protected from any modifications during invocation of this
function, it should not be called.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>dataset_location</code></em>&#160;:</span></p></td>
<td>the location identifying the dataset.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>func</code></em>&#160;:</span></p></td>
<td>the function to call for each data element.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td>
<td>user data to pass to the function.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3416422"></a><h3>
<a name="GDataForeachFunc"></a>GDataForeachFunc ()</h3>
<a class="indexterm" name="id3416434"></a><pre class="programlisting">void                (*GDataForeachFunc)                 (<a class="link" href="glib-Quarks.html#GQuark">GQuark</a> key_id,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data,
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);</pre>
<p>
Specifies the type of function passed to <a class="link" href="glib-Datasets.html#g-dataset-foreach"><code class="function">g_dataset_foreach()</code></a>.
It is called with each <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> id and associated data element,
together with the <em class="parameter"><code>user_data</code></em> parameter supplied to <a class="link" href="glib-Datasets.html#g-dataset-foreach"><code class="function">g_dataset_foreach()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>key_id</code></em>&#160;:</span></p></td>
<td>the <a class="link" href="glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> id to identifying the data element.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
<td>the data element.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td>
<td>user data passed to <a class="link" href="glib-Datasets.html#g-dataset-foreach"><code class="function">g_dataset_foreach()</code></a>.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3416581"></a><h3>
<a name="g-dataset-destroy"></a>g_dataset_destroy ()</h3>
<a class="indexterm" name="id3416594"></a><pre class="programlisting">void                g_dataset_destroy                   (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> dataset_location);</pre>
<p>
Destroys the dataset, freeing all memory allocated, and calling any
destroy functions set for data elements.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>dataset_location</code></em>&#160;:</span></p></td>
<td>the location identifying the dataset.


</td>
</tr></tbody>
</table></div>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id3416645"></a><div class="refsect2" lang="en"><a name="id3416646"></a></div>
<hr>
<div class="refsect2" lang="en"><a name="id3416647"></a></div>
</div>
</div>
</body>
</html>
